UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'exEAR+Y+WlcjOTbgfg7AgfuAuKB30nPIapw3sa9HC8E=' 
WHERE 
  key_id = '3b608a999f76f1356f777c3e3b1f35f499140624d9d1c0871a51940c1af149b7' 
  AND (
    token = 'exEAR+Y+WlcjOTbgfg7AgfuAuKB30nPIapw3sa9HC8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048