UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MtgySmnJHcE9eP+sO1miOsm7Vxvbxd2mXIaMb0yAHgQ=' 
WHERE 
  key_id = '08851fffc0ae60652793c5fa33ee091b8cea0a61e21975761e7f528c7c14d9d7' 
  AND (
    token = 'MtgySmnJHcE9eP+sO1miOsm7Vxvbxd2mXIaMb0yAHgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030