UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SfCHoJQaktLzamcUAzzRYlonpIC9JQfLWY4icJYpXec='
WHERE
key_id = 'c5d1100af0f4907fbd135c380fc2a262269683f7a44cb6850473b8bd6df078a0'
AND (
token = 'SfCHoJQaktLzamcUAzzRYlonpIC9JQfLWY4icJYpXec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)