UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's1RK03Evur2lhL0/jwTwqUqaVoA4Xl7okOfWgwpIeZU='
WHERE
key_id = 'b156dca8f5d4563a59836dc2654751fab6dbc7364482124947616102326c8ad0'
AND (
token = 's1RK03Evur2lhL0/jwTwqUqaVoA4Xl7okOfWgwpIeZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)