UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kc7a69eu3niUTPdfXw3ymYTivKjar/nLodm3iNI5LxY=' 
WHERE 
  key_id = '78ce8e386e3ed29ae449bdadbaf53ae81d76594f4032338ed93efb87a74a6a10' 
  AND (
    token = 'Kc7a69eu3niUTPdfXw3ymYTivKjar/nLodm3iNI5LxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048