UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'izwxZ99hA+WQgaiclxEUo19BvJO88I9+Buk6hUAJNEM=' 
WHERE 
  key_id = 'b5094b2d3a990937ee4e0b8e1a0917a50e4f857df6a4b2cfb3a65553e5ed7f11' 
  AND (
    token = 'izwxZ99hA+WQgaiclxEUo19BvJO88I9+Buk6hUAJNEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042