UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NFZ4R1M3K3DD2h9Bq+Wuw+QbEB99Q6DfrtXs2uCDIZY=' 
WHERE 
  key_id = '1a8e00c285c739b66c1b9a35dc17e84d288c684cd19a9a1b88f4ba1cbee40a72' 
  AND (
    token = 'NFZ4R1M3K3DD2h9Bq+Wuw+QbEB99Q6DfrtXs2uCDIZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024