UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uiCbCroCO7ARDpvw5W8N9N5XflolyIYm17jSDM577SU='
WHERE
key_id = '60d2c52019a4dac84b8ca4b7eb1fecc15b02e70028bdca90d3e105d295de436f'
AND (
token = 'uiCbCroCO7ARDpvw5W8N9N5XflolyIYm17jSDM577SU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)