UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utWyEqh8MHf/xg/vkPg6o16wITAnQdd4+79UscZXJJg=' 
WHERE 
  key_id = '11277f80029a0b5fa9d162ef3298b313f02e3812fa75f87d8ae631492ad9b2e1' 
  AND (
    token = 'utWyEqh8MHf/xg/vkPg6o16wITAnQdd4+79UscZXJJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025