UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mAp3G7JBHtFAf0sfLEQJ2xSj8mqNU54T2MtGL5cQd1g='
WHERE
key_id = '0e618373dc07e8d8884ad74a9424377a1943b4f400b95eda680e8935c3d9405e'
AND (
token = 'mAp3G7JBHtFAf0sfLEQJ2xSj8mqNU54T2MtGL5cQd1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)