UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Au/9t+fbyKq8zNH1GAGKAnV9TdyvxSHBcwYqITViOk='
WHERE
key_id = 'a7c74ba4d47e7e1178eba4acdae085619bd38c6128c6154ca9d1c748a4f7a1b6'
AND (
token = '3Au/9t+fbyKq8zNH1GAGKAnV9TdyvxSHBcwYqITViOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)