UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7sbixYNNf/TWF0SxyoVMCPElL8+U0zjaZGbSaPzrL5E='
WHERE
key_id = '945d5221e7edb518561b0c3d4f600c0e09a55e5f23529b70acd9f9d1b626ae73'
AND (
token = '7sbixYNNf/TWF0SxyoVMCPElL8+U0zjaZGbSaPzrL5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)