UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LOQPDGO46RjK0DTkYbDKRv+ZPbFjt0HOF3wUl5moDwU=' 
WHERE 
  key_id = 'b31bd55f7dd3cbe0e4e145f60cfd2638147134d23556708ff66fa7e7c0881c0c' 
  AND (
    token = 'LOQPDGO46RjK0DTkYbDKRv+ZPbFjt0HOF3wUl5moDwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024