UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggeG/653NvoykJ2t1XFSlVPMiodJIxEjX75klb3rpeo=' 
WHERE 
  key_id = '1e0b7a90d71772d4b795a775ea9e5cd35c352f953a69edcd9c211d7a3f73fec4' 
  AND (
    token = 'ggeG/653NvoykJ2t1XFSlVPMiodJIxEjX75klb3rpeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017