UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Co7lZUUMmMtrY9WQiIr8t7rQy8nUWm68hpkG7F8AfR8='
WHERE
key_id = '678fab0bcf5df01a3dd8ff63f82484dfb408f22cf0733a3070469cd04b9c4385'
AND (
token = 'Co7lZUUMmMtrY9WQiIr8t7rQy8nUWm68hpkG7F8AfR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)