UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4bxgT9IfkmU94I3DbXugCyZpqWReuUrsUY2kHnndM3U='
WHERE
key_id = '050f7e8e5628380c690f963db665ba977e74a0f33b208db28f17305434bad0d5'
AND (
token = '4bxgT9IfkmU94I3DbXugCyZpqWReuUrsUY2kHnndM3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)