UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JpoOTrYISLGRKelY9Gsve1iuNYvHzWd3867HpQ9/GiM='
WHERE
key_id = '6846fabab9d2e3aeb85c9d54e88c529bb7bb6046e7c955751c094f4c0065bdc0'
AND (
token = 'JpoOTrYISLGRKelY9Gsve1iuNYvHzWd3867HpQ9/GiM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)