UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lS81oI/YH5F7qQwnPNB5uUUKWgw/xtwSGsHmi2AHVOQ=' 
WHERE 
  key_id = 'da9cd8e4058a26706e81a54f7203e003dc0e06b9138ba1b2a4de9878e69185fb' 
  AND (
    token = 'lS81oI/YH5F7qQwnPNB5uUUKWgw/xtwSGsHmi2AHVOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039