UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WRIjnzwYAlyJjSnEYGudMSZhPVMKYHrrNF/BsTp3TbI='
WHERE
key_id = '9a0fa5525640e06c847c804055d8e6cc1f7e23282e4476de2f914e827d3eb12b'
AND (
token = 'WRIjnzwYAlyJjSnEYGudMSZhPVMKYHrrNF/BsTp3TbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)