UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+aMWcQFMpPQzfb1AdFnzzboGpJOtVAeAOBCc3idF20U='
WHERE
key_id = 'd3c1a2f6f2457637afa790937d5439e9c89e2716dd9d6f5ac685dbd1c1369ee6'
AND (
token = '+aMWcQFMpPQzfb1AdFnzzboGpJOtVAeAOBCc3idF20U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)