UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZKLXth0GyAeMrcJMh6mqchTg+V/cR+mweNbEYcdV4OE='
WHERE
key_id = '7e8c0f59bd6db2ee98ac104dae2ea0b4ee6e3a3fef2890d44fcfd629d0a9b2f9'
AND (
token = 'ZKLXth0GyAeMrcJMh6mqchTg+V/cR+mweNbEYcdV4OE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)