UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lQJOBimGig/E2Bx+dNLPN0XLnjnLtxMfdC0le+g4hS4='
WHERE
key_id = '0f7d2d7926310db0f193ad0a2b70a74f5b7297b04f7cbaea91a55ed3acd40ba7'
AND (
token = 'lQJOBimGig/E2Bx+dNLPN0XLnjnLtxMfdC0le+g4hS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)