UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0U93lnkk7sPaSB4+zQIoph9wafUtVvHj3qyEHNWzSZU='
WHERE
key_id = '1ee4b546482e219b34bca88eacca5880c142e21528e442862a4e9fa41925eb23'
AND (
token = '0U93lnkk7sPaSB4+zQIoph9wafUtVvHj3qyEHNWzSZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)