UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WtR4Ap1JJpwXuw7t4QvnwCRBh8C0qtc8dlPiAVWMJlk='
WHERE
key_id = '60a588ec96038d46b9d154321f26c5e44ac34930ddc6176855bceff1ad24bda1'
AND (
token = 'WtR4Ap1JJpwXuw7t4QvnwCRBh8C0qtc8dlPiAVWMJlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)