UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TF7z7GmIysaGsqGvEaZfXRDxT9aTVKs/wulk5qmKTFc=' 
WHERE 
  key_id = '1ced47e4b903d3edfcdacb4079e1aad50a89f64fdb184cfb34e465658c260965' 
  AND (
    token = 'TF7z7GmIysaGsqGvEaZfXRDxT9aTVKs/wulk5qmKTFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024