UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BkCTUtvTQ1/tpz4z/Gp0ZmydSyMjzJoTbpp86vBZbF8=' 
WHERE 
  key_id = '424c85d8d40b20a40058cbdfc7e0c08eba97f6c508611b8a56b3a5bfc0eec134' 
  AND (
    token = 'BkCTUtvTQ1/tpz4z/Gp0ZmydSyMjzJoTbpp86vBZbF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017