UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LlKmCPcjxB9isAnINvxxDcqQqInRN2ai333K9aEtRcg=' 
WHERE 
  key_id = '88f22aa26d950ae3a9f729b100d0acfe281a22d0bb51163e89a90a5ad6c8fe60' 
  AND (
    token = 'LlKmCPcjxB9isAnINvxxDcqQqInRN2ai333K9aEtRcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035