UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wMMS9iWO8hZ7Q7o0H4MPHAvvoF5OlN6p7qSMHnxfZ/o='
WHERE
key_id = 'bba0894f62c162eb3bd1b06ba8a0a4927cd7815fd9f864de6cd53fde71359b52'
AND (
token = 'wMMS9iWO8hZ7Q7o0H4MPHAvvoF5OlN6p7qSMHnxfZ/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)