UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U93y4X0kHCyifozyNfzJ5t1izTLwIc/S32JeomenueM=' 
WHERE 
  key_id = 'f07297eb425b5c2b4743a929174bc5ee5c78b92a0c3d4edc56b955bd239e6836' 
  AND (
    token = 'U93y4X0kHCyifozyNfzJ5t1izTLwIc/S32JeomenueM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052