UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0MZSGSIVb3uGKAF4wbAJGY8CkSENl6hZiOEcsgBhEBc='
WHERE
key_id = '843acd67b4b86eea761287fd74eb78d397b172aa1720b0fbecd4fdcac28d1508'
AND (
token = '0MZSGSIVb3uGKAF4wbAJGY8CkSENl6hZiOEcsgBhEBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)