UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wiu6pYXg78CcPIREYV5cKA2VrWTOmfeBVSz3dgDHsyg=' 
WHERE 
  key_id = 'df6fcfcbb4a9bf534267c0fc151eb036720bd5cf1d413241af847fbda42d7ab3' 
  AND (
    token = 'wiu6pYXg78CcPIREYV5cKA2VrWTOmfeBVSz3dgDHsyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049