UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ybAsMpJ3E0Lur6qkYKeAqVAUmk+K7/ZUzRG3MLaVqQE='
WHERE
key_id = '9a9f0ecb7eccac0890d6c57cddccc1a4e5581fd7012ba194a9df3ceeaa257cc2'
AND (
token = 'ybAsMpJ3E0Lur6qkYKeAqVAUmk+K7/ZUzRG3MLaVqQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)