UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMK6EM316g7WMRQYDG1POBMw+ZbaDnro+fmUJ/6csmQ='
WHERE
key_id = '90c59d3a083f10517b0db32fde6ed8793a983a4ab9e7e0abaea7a1420f41ed8a'
AND (
token = 'UMK6EM316g7WMRQYDG1POBMw+ZbaDnro+fmUJ/6csmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)