UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3RxiH6QbR/JeVRXaFZRnc1aeZZZaZLbdFnrQbNVuiV4=' 
WHERE 
  key_id = '00951abbbaa86ff7a7d30054ebff7858d3444889df9656b2bee112c0f33ed548' 
  AND (
    token = '3RxiH6QbR/JeVRXaFZRnc1aeZZZaZLbdFnrQbNVuiV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036