UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pwQM9ZtzaF4Qif1svFnNuCVfYw2Ylb1OjO2V0VxF3+4='
WHERE
key_id = '29115e91d422abf77c0f7619e647c94ba8fb569e4d57d2b26de5c0676a5a3936'
AND (
token = 'pwQM9ZtzaF4Qif1svFnNuCVfYw2Ylb1OjO2V0VxF3+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)