UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm09YU546Xib3lzMDkiMjkjZXe913CofduNJdX9MP+yQ='
WHERE
key_id = '8b8064a4d4a6d8c054e56b19e7bf88833df7a9882a70e214163f8a120c3286fd'
AND (
token = 'm09YU546Xib3lzMDkiMjkjZXe913CofduNJdX9MP+yQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)