UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ONujxBVKEJYkCaDYzRWfAKyh0IBJkaeKzxouNuhqF0='
WHERE
key_id = '15d385973735c7ab2e4a433902f6601d7a1982c441c5960c018ee3415cd1cdda'
AND (
token = '5ONujxBVKEJYkCaDYzRWfAKyh0IBJkaeKzxouNuhqF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)