UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zpIl2y9aNV4ga9sJcMPYz0KDv0h+2VNNe6tmoUOoRG0=' 
WHERE 
  key_id = 'ba106a7b1262a971f53ea9d390a76ad7377c971d1a93e8815f5f2aefc0191225' 
  AND (
    token = 'zpIl2y9aNV4ga9sJcMPYz0KDv0h+2VNNe6tmoUOoRG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018