UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9DHSwrkZ3St/OVq2pOHmrjnY5osZO3uNmpkdZqKWghY='
WHERE
key_id = '160c99f4ff4b3eb4832847822e99ffbd9b299246e348133871a007870257c252'
AND (
token = '9DHSwrkZ3St/OVq2pOHmrjnY5osZO3uNmpkdZqKWghY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)