UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '78zBwfuTy70FyVoxETf2Yq9J1Y5NdtK9J8bhMd8HQaA='
WHERE
key_id = 'a53b7a09bdc84f0a58e0c2e91bef79dfb90bddcd2f4f96de9821db2bd5ee0b37'
AND (
token = '78zBwfuTy70FyVoxETf2Yq9J1Y5NdtK9J8bhMd8HQaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)