UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'inVl5YrLhrQh7t5I9ipNPN5DvykURV4A1xSbHFW7c6M='
WHERE
key_id = '70bebf239d7ec728d2b4637435b0cae7fb0da62fda4ba67c3289fc5029d8000d'
AND (
token = 'inVl5YrLhrQh7t5I9ipNPN5DvykURV4A1xSbHFW7c6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)