UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UizX9FsUep0Oi5GLtkwe9kzDCjUNJDcc+5LjyUqWoxg=' 
WHERE 
  key_id = '4feec67a6360e4f79cef9a6d8a4cf4914cfcd5e7f68ddd8b2a77a942cc680bda' 
  AND (
    token = 'UizX9FsUep0Oi5GLtkwe9kzDCjUNJDcc+5LjyUqWoxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039