UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+EKHcjCSvmArQGJ5PChSgtfECM6dhl8neGn9k4dElPw=' 
WHERE 
  key_id = '293d0e4584b80f35d81b5c26ae99a5483e0b134f913d2116ef9aa27290d0cb0a' 
  AND (
    token = '+EKHcjCSvmArQGJ5PChSgtfECM6dhl8neGn9k4dElPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015