UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NWdvmRweesB/dAYWJqmdzR9f/UN/sC48X8DfxG36Xmg='
WHERE
key_id = '6f26ecf177e7e9534890ed68a04eced4a8c5fecc2b25d0772471e51ee519f39d'
AND (
token = 'NWdvmRweesB/dAYWJqmdzR9f/UN/sC48X8DfxG36Xmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)