UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fDCHlwkQaV4IJ2XkujjSp2oQ+hkIeTJ4jiAZovVf2Zc='
WHERE
key_id = '0d6388deaf703dd8d9a05df6597dfeaa2532dcd1d5f0ec5a1e53ac4fb7928488'
AND (
token = 'fDCHlwkQaV4IJ2XkujjSp2oQ+hkIeTJ4jiAZovVf2Zc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)