UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nGWIELhxVhQNmMiRhD4N09PZ+xnbfxve4gwDrxoxf3E='
WHERE
key_id = 'c2eddc917ce6fdf9f5b94108b47924b1cd7c3fcd5f1e635e55849a9ffe5dec8c'
AND (
token = 'nGWIELhxVhQNmMiRhD4N09PZ+xnbfxve4gwDrxoxf3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)