UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YPZrxqt/6ibWOTpTMJxFl0t/4teV9kZvQECXsos+wWk=' 
WHERE 
  key_id = 'e22dcfc4b33ad5b904b10c5855b616f545fab68ab5be968ee2686400c2a0c511' 
  AND (
    token = 'YPZrxqt/6ibWOTpTMJxFl0t/4teV9kZvQECXsos+wWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014