UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g3E7NR0YKkl6dlM2UQgq4zm34tRhdD+jRySqvvMLyBU='
WHERE
key_id = 'efe3fa781e860a443173e939a5166ba69c97614ef0cbe496a7125d03790b78fa'
AND (
token = 'g3E7NR0YKkl6dlM2UQgq4zm34tRhdD+jRySqvvMLyBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)