UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5vyqvlENrS4bvVBMt6UDLFLwBzk1K2/8NTgmXAq4LV0='
WHERE
key_id = '36390e3abaf8373109f9f2bbb95f83bc82ff98e826c5a33d6fc2b3024be46ab2'
AND (
token = '5vyqvlENrS4bvVBMt6UDLFLwBzk1K2/8NTgmXAq4LV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)