UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mZP6BN3oiz36TNPMos4+Iq7/GyYFuDMM1XyaZVG/ihA=' 
WHERE 
  key_id = '2a7f5aa8954d26c64d9aeb9e50e91b106f198b252b292cf020702b4e2ded8b8f' 
  AND (
    token = 'mZP6BN3oiz36TNPMos4+Iq7/GyYFuDMM1XyaZVG/ihA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036