UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cwc9+NhLYmEfPBpA0kZ0X48TkVouUf1eWu7d80ZJ96w='
WHERE
key_id = 'c0257f0a0528eb7011aacd09d6f4ad422bc56dd25913da181ab9c8049d360d9c'
AND (
token = 'Cwc9+NhLYmEfPBpA0kZ0X48TkVouUf1eWu7d80ZJ96w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)