UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DigY/Kv+8JKTGJPenVzWvPq4xk+iYLrydmGm0LxzL+8=' 
WHERE 
  key_id = '9eebbca8837295f9891c6180b5a8efdfd667b2c8f36ef3e3fa0cba82a43013d9' 
  AND (
    token = 'DigY/Kv+8JKTGJPenVzWvPq4xk+iYLrydmGm0LxzL+8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039