UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'URk2mBArR0jd2AcHf+cGESM9egZ0oEkBpDXoeQ7ux+g='
WHERE
key_id = 'a4fca0896e5ecaad87d2923fcdf117cc0eb813ac78f261e6fe180e55118df6b3'
AND (
token = 'URk2mBArR0jd2AcHf+cGESM9egZ0oEkBpDXoeQ7ux+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)