UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlnRnW50jAml1PCiHJqBf5G28JZwQyPUOZTykND+B5E=' 
WHERE 
  key_id = '33e854991fd4fd657d2150ffd3068128bdedaa66087c8c0488d2fe2ab81b45df' 
  AND (
    token = 'rlnRnW50jAml1PCiHJqBf5G28JZwQyPUOZTykND+B5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020