UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0tAgowwsBEiq3zwwhCBB9gfnTvRLlekihQBPUNi8kPw='
WHERE
key_id = '7b9e0a8a1f30e92a0d813244c98822115efc0ba6e0942c4ddda4e85d7df6c65c'
AND (
token = '0tAgowwsBEiq3zwwhCBB9gfnTvRLlekihQBPUNi8kPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)