UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LbFVW2Arqb9tI+Z144h9BcZbU0VAmQ65mTKLVdFWDxM='
WHERE
key_id = 'c364731b0186cb728a7d0b9217f38fbfd8f59b2090e2790620e7fa38807c21fb'
AND (
token = 'LbFVW2Arqb9tI+Z144h9BcZbU0VAmQ65mTKLVdFWDxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)