UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lZD9DZ+4hHQriLQ2vEAubEUHGro9gcGIk8CDWbxOd5g='
WHERE
key_id = '8436a976e11c91e73fb352f435716d8563171ce4fdea9eafe8e37c0b887a6f10'
AND (
token = 'lZD9DZ+4hHQriLQ2vEAubEUHGro9gcGIk8CDWbxOd5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)